


public class Vektor
{
	private double	x, y;	// projekcije vektora na ose
		
	public Vektor(double _x, double _y)
	{
		x = _x; y = _y;
	}
	
	public void x(double nx)
	{
		x = nx;
	}
	
	public void y(double ny)
	{
		y = ny;
	}
	
	public double x() { return x; }
	
	public double y() {	return y; }

	public Vektor mnozi(double t)
	{
		x *= t;
		y *= t;
		return this;
	}
	
	public Vektor proizvod(double t)
	{
		return new Vektor(x*t, y*t);
	}
	
	public Vektor dodaj(Vektor v)
	{
		x += v.x;
		y += v.y;
		return this;
	}
	
	public Vektor zbir(Vektor v)
	{
		return new Vektor(x+v.x, y+v.y);
	}
}